#include<bits/stdc++.h>
#define int long long
#define endl '\n'
using namespace std;
const int mod=998244353,inf=0x3f3f3f3f3f3f3f3f;
const int N=2e5+10,M=2e5+10;
mt19937 rnd(time(0));
signed main()
{
	ios::sync_with_stdio(false);
	cin.tie(0),cout.tie(0);
//	freopen(".in","r",stdin);
	freopen("fire.in","w",stdout);
	int n=4000,q=5e4;
	cout << n << " " << q << endl;
	while(q--)
	{
		int op=1;
//		if(op>1)op=2;
		cout << op << " ";
//		cout << n << " " << n << endl;
		if(op==1)
		{
			cout << rnd()%2 << " " << rnd()%n+1 << " " << 4 << " " << rnd()%100000+1 << endl;
		}else{
			cout << rnd()%n+1 << " " << rnd()%n+1 << endl;
		}
	}
	return 0;
}


